home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / MISC / ANSIKODE.ZIP / ANSI.TXT next >
Encoding:
Text File  |  1989-04-29  |  7.4 KB  |  163 lines

  1. THE........
  2.              ______           _______   ______                             ____
  3.     /     / /     / /     /      /     /     /  /|  /|     /|     / /     /
  4.    /     / /     / /     /      /     /     /  / | / |    / |    / /     /
  5.   /_____/ /     / /     /      /     /     /  /  |/  |   /__|   /_/     /__
  6.  /     / /     / / /|  /      /     /     /  /       |  /   |  /  \    /
  7. /     / /_____/ /_/ |_/      /     /_____/  /        | /    | /    \  /____
  8.                                        _____ ______
  9.                       /|     /|    /  /        /
  10.                      / |    / |   /  /        /
  11.                     /__|   /  |  /  /____    /
  12.                    /   |  /   | /       /   /
  13.                   /    | /    |/  _____/ __/___
  14.  
  15. File By:
  16.  
  17.                   |\      |\        /     |\   |\      /| |\   |\
  18.                   | \   / | \      /   /  | \  | \    /_| | \  | \
  19.                   ||\\ /__|__     /   /_  |__\ |__\  /  | |__\ ||\\
  20.                   ||// \  |      /____\   |    |    /   | | \  ||//
  21.                   | /   \ |            \                       | /
  22.                   |/      |                                    |/
  23.  
  24.                            Sysop of the Amiga Tele-Trader
  25.                            1200/2400/9600/19200 Hst USR 
  26.                            65 Megs
  27.                            over 250 one line Documents
  28.                            The Latest Warez.
  29.                            406-782-3161
  30.  
  31. Ok well it is about time someone make a file on how to make Ansi. There have 
  32. been a few made in the past but most were quite lacking! Well the first thing
  33. you will need is a text editor that allows you to put escape into a file.
  34. A good one is MicroEmacs on the extras disk. It has a function called 
  35. Quote-char that allows you to put Ascii code 27 in your text file (the Escape
  36. Key). To put an escape character in your file on MicroEmacs type Ctrl-Q then
  37. hit the escape key. It will type a "^[" on the screen this is how the escape
  38. code is symbolized by this text editor. Now all you need are a few codes and
  39. your imagination and you are off. There is one thing you must know. If you
  40. plan to use your ansi on a BBS there are two types of Ansi (Vt-100 & Vt-102)
  41. supporting term programs. There are the 8 color ones (Online! for example)
  42. which allow 8 colors on the screen and usually have a black background color
  43. and then there are the 4 color term programs (Like Diga!) that only allow
  44. 4 colors on the screen and usually have a blue background. If you use 8 colors
  45. in your Ansi graphics and someone calls you with a 4 color term program they
  46. will not see the last four colors or the last four will be displayed as white
  47. which is how some terms handle the extra colors. Either way they will probably
  48. not be able to understand your graphics so it is a good idea to make two sets
  49. of menus and/or other files that are printed on the bbs one for 8 color users
  50. and one for 4 color users.
  51.  
  52.    First of all there are the 8 foreground color codes:
  53.  
  54.    30.......Black (invisible) _
  55.    31.......Red                \
  56.    32.......Green               |----- Use onle 30-33 for 4 color terms
  57.    33.......Yellow            _/
  58.    34.......Blue
  59.    35.......Magenta
  60.    36.......Cyan
  61.    37.......White
  62.    
  63.    Then there are the 8 Background color codes:
  64.  
  65.    40.......Black (no background color) _
  66.    41.......Red                          \
  67.    42.......Green                         |---Use only 40-43 for 4 color terms
  68.    43.......Yellow                      _/
  69.    44.......Blue
  70.    45.......Magenta
  71.    46.......Cyan
  72.    47.......White
  73.  
  74. Ok so lets say you want to print the word welcome in blue letters with a yellow
  75. background. You would type (for microemacs) a CTRL-Q the the ESC key. This would
  76. give you the ^[. Then type [43;34m. This would show up as a ^[[43;34m on the
  77. screen. For any color changes you must put the "m" (make sure its lowercase!)
  78. at the end this tells the term program its the end of the Ansi sequence. You 
  79. do not always have to specify the background/forground colors. If you wanted
  80. to change the text to Black but leave the background yellow just type
  81. ^[[30m because once you set a background or foreground it stays that way until
  82. you set it different. So one last time if you wanted to print the word AMIGA
  83. with each letter a different color with a black back ground it would look like
  84. this (on MicroEmacs):
  85.  
  86.  ^[[31mA^[[32mM^[[33mI^[[34mG^[[35mA
  87.  
  88. this would give you: 
  89.  
  90. AMIGA
  91.  
  92. Ok now onto the much more fun stuff Cursor Movement. There are 2 ways to move
  93. the cursor. 
  94.  
  95. 1. To specify a Row and Column for the cursor.
  96. 2. To tell the cursor to move in relationship to its current location.
  97.  
  98. Either way is quite easy and they each have their own benefits.
  99.  
  100. Ok to place the cursor at Row 3 column 50 the sequence would look like this.
  101.  
  102.    ^[[3;50H (make sure you put an H at the end of this sequence just like the
  103.              m for color.)
  104.  
  105.    It is quite easy to do cursor movements this way but the file can become 
  106. quite LONG! 
  107.  
  108. The second way is to make cursor movements relative to the currsors last 
  109. location. Such as moving it up 10 over 5 or something.
  110.  
  111. This is done with 4 different ansi codes :
  112.  
  113.   ^[[nA Up   ___
  114.   ^[[nB Down    \
  115.   ^[[nC Right    |--------- Where the n is the number of space you want to move
  116.   ^[[nD Left ___/
  117.    
  118. So a ^[[30D^[[10A would move the cursor right 30 and up 10.
  119.  
  120. The final phase! Viewing your new creation.
  121.  
  122. There are a few ways you can view your new creation. If you are setting it up
  123. for use on a bbs just logon locally and type the file from the BBS it will 
  124. show it to you in Ansi mode. If you created a 4 color picture just open a CLI
  125. make it full screen size if you have cursor movement so it looks right and type
  126. it, it will show it to you in ANSI. This is also a good way to see what an 8 
  127. color picture looks like to a 4 color term user because workbench is only 4
  128. colors. There are just about no other ways to view an 8 color ansi file unless
  129. you were to set up 8 color workbench with the PD program to make an 8 color
  130. workbench.
  131.  
  132. Oh ya there are also a few other ansi codes that may help you a little:
  133.  
  134.    ^[[0m...... Normal text (resets color type style and everything else)
  135.    ^[[1m...... Bold text
  136.    ^[[4m...... Underline (good for making unbroken straitlines)
  137.    ^[[5m...... Italics (will cause text to Blink on an IBM)
  138.    ^[[7m...... Italics (will make italics on amiga and IBM)
  139.    ...... Truns cursor off completely it does what you tell it to but
  140.                all actions are invisible.
  141.  
  142. The above codes can be put together in a color code sequence like:
  143.  
  144.  ^[[34;41;7m would make it blue on red with italics turned on. Remember you
  145. have to shut off the italics or ieverything after that will be printed in
  146. italics and to turn it off you must send a ^[[0m then the colors are returned
  147. to noramal also you must reset them back to what you were using before if you
  148. want to stay with that color!
  149.  
  150. Ok well now you are all ready to create your masterpiece! Also to view Ansi
  151. remember you must be set at VT-100 or VT-102 and at 8N1. 
  152.  
  153.  
  154. Special note to BBS-PC! users. If you make a text file with the above codes 
  155. it will work fine but if you want ansi in the Menu instead of putting the
  156. CTRL-Q esc key in the title ="" lines just put a \27 it works the same.
  157.  
  158. So make a picture today and upload it to the special Ansi Graphics contest of
  159. the amiga tele-trader! Your picture may be the best and be displayed on the log
  160. off screen and you recieve 5 Upload credits!
  161.  
  162. New Contest EVERY MONTH! 
  163.